package org.rslai.tcedit.domain;

import java.sql.Clob;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.validator.Length;
import org.rslai.tcedit.util.StrUtil;

/**
 * 保存用户输入信息
 * 
 * @author rslai
 */
@Entity
@Table(name="t_hold_input_Info")
public class HoldInputInfo extends UUIDSupport {
	private String formName; // 窗体名称
	private String formulaName; // 公式名称
	private Clob inputInfo; // 输入信息
	private String inputInfoStr; // 输入信息 字符串


	@Column(nullable = false, length = 100)
	@Length(max = 100, message = "窗体名称请限制在100字以内")
	public String getFormName() { return formName; }
	public void setFormName(String formName) { this.formName = formName; }

	@Column(nullable = false, length = 50)
	@Length(max = 50, message = "公式名称请限制在50字以内")
	public String getFormulaName() { return formulaName; }
	public void setFormulaName(String formulaName) { this.formulaName = formulaName; }

	@Lob
	@Basic(fetch = FetchType.LAZY) 
	@Column(nullable = true, length = 16777216)   
	public Clob getInputInfo() { return inputInfo; }
	public void setInputInfo(Clob inputInfo) {
		this.inputInfo = inputInfo;
		this.inputInfoStr = StrUtil.toString(inputInfo);
	}
	@Transient
	public String getInputInfoStr() { return inputInfoStr; }
	@Transient
	public void setInputInfoStr(String inputInfoStr) {
		this.inputInfoStr = inputInfoStr;
		this.inputInfo = StrUtil.toClob(inputInfoStr);
	}

}
